﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PersonEmpImportList.aspx.cs" Inherits="RN.ERP.Web.Person.PersonEmpImportList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../Styles/skins/blue/css/style.css" rel="stylesheet" type="text/css" />
    <link rel="Stylesheet" type="text/css" href="../Scripts/ligerUI/skins/Aqua/css/ligerui-all.css" />
    <script src="../Scripts/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../Scripts/ligerUI/js/ligerui.min.js"></script>
</head>
<body>
    <form id="form1" runat="server">
      
<input id="hdClassId" type="hidden" runat="server" value="0" />
<input id="hdCorpGuid" type="hidden" runat="server" value="" />
<input id="hdAreaCode" type="hidden" runat="server" value="" />
<input id="hdRoleType" type="hidden" runat="server" value="" />
 <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
        <%-- <tr>
            <td colspan="4" height="30" class="position">
                您所在的位置：<a href="#">首页</a>&gt;&gt;<span class="blue">人员列表</span>
            </td>
        </tr>--%>
        <tr>
            <td width="19" class="xx_m">
                <img src="../images/xx_l.jpg" width="19" height="33" />
            </td>
            <td width="24" class="xx_m  tt_xx_icon">&nbsp;</td>
            <td width="1250" class="xx_m">
                人员列表
            </td>
            <td width="14">
                <img src="../images/xx_r.jpg" width="14" height="33" />
            </td>
        </tr>
        <tr>
            <td class="left_con">
                &nbsp;
            </td>
            <td colspan="2" style="padding-left: 6px; padding-right: 6px;" valign="top">
                <!--#订单列表-->
                <div class="xian">
                    <div class="about_title">
                        人员列表</div>
                    <div class="i-con-cn">
                     <asp:LinkButton ID="LinkButton1" runat="server" CssClass="xtbiao" OnClientClick="return CheckEmpImport();">导 入</asp:LinkButton>
                        <asp:LinkButton ID="lbtnEmpSreach" runat="server" CssClass="xtbiao" OnClick="lbtnEmpSreach_Click">查 询</asp:LinkButton>
                       
                    </div>
                </div>
                <!--[if lte IE 6]> <div style="width:740px;overflow:auto"> <![endif]-->
                <div style="padding-bottom: 5px;
                    background-color: #eaeaea; width: 100%; padding-top: 5px; margin-bottom: 10px;">
                    <table>
                        <tr>
                       
                            <td align="center" style="width: 40px;">
                                姓名
                            </td>
                            <td>
                                <asp:TextBox ID="txtEmpName" runat="server" MaxLength="10" Width="100px" CssClass="text_css"></asp:TextBox>
                            </td>
                            <td style="width: 50px;" align="center">
                                身份证
                            </td>
                            <td>
                                <asp:TextBox ID="txtEmpIdCard" runat="server" MaxLength="30" CssClass="text_css"></asp:TextBox>
                            </td>
                           
                        </tr>
                    </table>
                </div>
                <div>
                    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
                        <AjaxSettings>
                            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                                <UpdatedControls>
                                    <telerik:AjaxUpdatedControl ControlID="rgPersonList" LoadingPanelID="gridLoadingPanel">
                                    </telerik:AjaxUpdatedControl>
                                </UpdatedControls>
                            </telerik:AjaxSetting>
                            <telerik:AjaxSetting AjaxControlID="rgPersonList">
                                <UpdatedControls>
                                    <telerik:AjaxUpdatedControl ControlID="rgPersonList" LoadingPanelID="gridLoadingPanel">
                                    </telerik:AjaxUpdatedControl>
                                </UpdatedControls>
                            </telerik:AjaxSetting>
                        </AjaxSettings>
                    </telerik:RadAjaxManager>
                    <telerik:RadGrid ID="rgPersonList" runat="server" OnNeedDataSource="rgPersonList_NeedDataSource"
                        AutoGenerateColumns="False" AllowPaging="True" AllowCustomPaging="True" AllowFilteringByColumn="false"
                        AllowSorting="True" PageSize="10" ShowStatusBar="True" CellSpacing="0" Culture="zh-CN"
                        GridLines="None">
                        <ClientSettings ReorderColumnsOnClient="True" AllowColumnsReorder="True" EnableRowHoverStyle="true">
                        </ClientSettings>
                        <MasterTableView AutoGenerateColumns="False" NoMasterRecordsText="暂无数据">
                            <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                            <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridTemplateColumn HeaderText="选择" HeaderStyle-Width="50px">
                                    <ItemTemplate>
                                        <input id="ckb" type="checkbox" value='<%#Eval("EmpGuid") %>' runat="server" />
                                    </ItemTemplate>
                                    <ItemStyle Width="50px"></ItemStyle>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn DataField="EmpGuid" DataType="System.String" HeaderText="EmpGuid"
                                    UniqueName="EmpGuid" Visible="false">
                                </telerik:GridBoundColumn>
                              
                                <telerik:GridTemplateColumn HeaderText="姓名">
                                    <ItemTemplate>
                                        <a href="javascript:void(0);" onclick="ShowViewForm('<%#Eval("EmpGuid") %>')" title="点击查看人员信息">
                                            <span style="color: #43a9f5">
                                                <%#Eval("Name") %></span></a>
                                    </ItemTemplate>
                                    <ItemStyle Width="65px"></ItemStyle>
                                </telerik:GridTemplateColumn>
                                <telerik:GridCalculatedColumn SortExpression="IDType" HeaderText="证件类型" DataFields="IDType"
                                    Expression='{0}=="1"?"身份证":"其他"' FooterText="CalculatedColumn footer" HeaderStyle-HorizontalAlign="Center">
                                    <ItemStyle Width="60px" HorizontalAlign="Center"></ItemStyle>
                                </telerik:GridCalculatedColumn>
                                <telerik:GridBoundColumn DataField="IDCard" DataType="System.String" HeaderText="证件号"  HeaderStyle-HorizontalAlign="Center"
                                    SortExpression="IDCard" UniqueName="IDCard">
                                    <ItemStyle Width="100px"></ItemStyle>
                                </telerik:GridBoundColumn>
                                <telerik:GridCalculatedColumn SortExpression="Sex" HeaderText="性别" DataFields="Sex"
                                    Expression='{0}==1?"男":"女"' FooterText="CalculatedColumn footer" HeaderStyle-HorizontalAlign="Center">
                                    <ItemStyle Width="45px" HorizontalAlign="Center"></ItemStyle>
                                </telerik:GridCalculatedColumn>
                                <telerik:GridBoundColumn DataField="Tel" DataType="System.String" HeaderText="电话" 
                                    SortExpression="Tel">
                                    <ItemStyle Width="80px"></ItemStyle>
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="MobileTel" DataType="System.String" HeaderText="手机" 
                                    SortExpression="MobileTel">
                                    <ItemStyle Width="80px"></ItemStyle>
                                </telerik:GridBoundColumn>
                              
                                <telerik:GridBoundColumn DataField="TypeFlag" DataType="System.String" Visible="false">
                                </telerik:GridBoundColumn>
                            </Columns>
                        </MasterTableView>
                        <PagerStyle AlwaysVisible="True" />
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                    </telerik:RadGrid>
                    <!--[if lte IE 6]> </div> <![endif]-->
                </div>
            </td>
            <td class="right_con">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="con_m tt_left_bottom">&nbsp;</td>
            <td colspan="2" class="con_m">&nbsp;</td>
            <td class="tt_right_bottom">&nbsp;</td>
        </tr>
    </table>
    <telerik:RadAjaxLoadingPanel runat="server" ID="gridLoadingPanel">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true"
        Skin="WebBlue">
      
    </telerik:RadWindowManager>
    </form>
</body>
</html>
<script type="text/javascript">
    function CheckSel() {
        var chk = $("input:checked");
        if (chk.length == 0) {
            $.ligerDialog.warn("请选择要操作的项！");
            return false;
        }
        return true;
    }
    function GetCheckVal() {
        var empGuid = "";
        $("input:checked").each(function () {
            empGuid += "," + $(this).val();
        });
        if (empGuid.length > 1) {
            empGuid = empGuid.substring(1);
        }
        return empGuid;
    }

    /*导入人员*/
    function CheckEmpImport() {
        if (!CheckSel()) {
            return false;
        }
        OpenConfirm('您确定要导入此信息？', confirmCallBackFn);
        return false;
    }
    function confirmCallBackFn(arg) {
        if (arg) {
            var empGuid = GetCheckVal();
            if (empGuid == "") {
                $.ligerDialog.warn("请选择要操作的项！");
                return false;
            }
            var areaCode = $("#<%=hdAreaCode.ClientID %>").val();
            var corpGuid = $("#<%=hdCorpGuid.ClientID %>").val();
            $.getJSON("../Handlers/PsnEmpInfoHandler.ashx", { "action": "empImport", "empGuid": empGuid, "corpGuid": corpGuid, "areaCode": areaCode, "rand": Math.random() }, function (data) {
                // OpenAlert(data.Message);
                OpenAlertFn(data.Message, returnToParent);
//                refreshGrid();
//                returnToParent();
            });
        }
    }
    /*刷新*/
    function refreshGrid() {
        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
    }
    //关闭窗口
    function returnToParent() {
//        parent.window.OnClientCloseAudit(result);
//        window.parent.$.ligerDialog.close(); ////关闭dialog
//        parent.$(".l-dialog,.l-window-mask").hide(); ////去除父窗体遮罩层

        top.ChildDialogCallBack = "OnClientCloseAudit";
        top.ChildDialogClose(1);
    }
    //弹出窗口
    function OpenConfirm(text, confirmCallBackFn) {
        $.ligerDialog.confirm(text, '', confirmCallBackFn);
        return false;
    }
    function OpenAlertFn(text,CallBackFn) {
        $.ligerDialog.warn(text,'', CallBackFn);
        return false;
    }
    function OpenAlert(text) {
        $.ligerDialog.warn(text);
        return false;
    }
    /*打开窗口*/
    function ShowViewForm(empGuid1) {
        opt = 2;
        top.$.ligerDialog.open({ url: "Person/PersonEmpView.aspx?empGuid=" + empGuid1 + "&typeFlag=-1&opt=" + opt, width: 1080, height: 800, title: '', buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
        return false;
    }

    </script>